package com.xmall.define.base;

import com.xmall.validate.group.AddGroup;
import com.xmall.validate.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * 新增/编辑请求基类
 */
@Data
public class BaseUpdateRequest implements Serializable {

    /**
     * 主键ID
     */
    @NotNull(message = "编辑ID不能为空", groups = { UpdateGroup.class })
    @Null(message = "编辑ID必须为空", groups = { AddGroup.class })
    private Long id;
}
